function analyzeChR2project

TracesPre = getChR2data('C:\Data\Taro\CELLS\TK0586\ave12-21.fig');

TracesPost = getChR2data('C:\Data\Taro\CELLS\TK0586\ave23-32.fig');

figure;

numTrace = length(TracesPre);
for k = 1:numTrace
    subplot(numTrace,1,k)
    plot(TracesPre{k} - TracesPost{k})
end
end
function trace = getChR2data(fig_file)
%     hfig = open([list(i).filename]);
    hfig = open(fig_file);
    lineObj = findobj(hfig,'Type','line');    
    
    % It is necessary to choose right traces. The order of line object does 
    % not correspond to the order of the lines.
    for k = 1:length(lineObj)
        trace{k} = get(lineObj(length(lineObj) - k + 1),'YData');        
    end
end